#include<stdio.h>
#include<math.h>
void print(char ch, int count) {
	while (count-- > 0)putchar(ch);
}	//print(ch,c)：打印ch字符c遍。
int main() {
	int n, ch, h,i;
	scanf("%d %c", &n, &ch);
	h = (int)sqrt((n + 1) / 2); //h=g(n)
	for (i = 1-h; i < h; i++){
		int j = abs(i);
		print(' ', h - 1 - j);	//空格
		print(ch, 2 * j + 1);	//ch
		putchar('\n');	//换行
	}
	printf("%d", n - (2 * h*h - 1));
	return 0;
}
/*#include <stdio.h>
int main(){
    int n, i = 1, s = 1, j, ret, k;
    char ch;
    
    scanf("%d %c", &n, &ch); //输入数据
    
    while (1){ //处理数据
        if (s == n){ //ret存放一行中最大的符号个数
            ret = i;
            break;
        }
        if (s > n){
            s -= 2 * i;
            ret = i - 2;
            break;
        }
        i += 2;
        s += 2 * i;
    }
    
    for (i=0; i<ret; i++){
        //计算每一行的字符个数k
        k = ret - 2 * i;
        if (k < 1){
            k += 4 * (i - ret/2);
        }
        
        //打印空格
        for (j=0; j<(ret-k)/2; j++){
            putchar(' ');
        }
        //打印字符
        for (j=0; j<k; j++){
            putchar(ch);
        }
        putchar('\n');
    }
    
    printf("%d", n - s); //输出数据
    
    return 0;
}
*/